package uml.internal;

public class Association {
	//- INNER CLASSES --------------------------------------------------------------------------------------
	public static class AssociationEnd {
		private final int id;
		private final boolean navigable;
		private final int associationId;
		private final String type;
		
		public AssociationEnd(int id, boolean navigale, int associationId, String type) {
			this.id = id;
			this.navigable = navigale;
			this.associationId = associationId;
			this.type = type;
		}

		public int getId() {
			return id;
		}

		public boolean isNavigable() {
			return navigable;
		}

		public int getAssociationId() {
			return associationId;
		}

		public String getType() {
			return type;
		}
	}
	
	//- PUBLIC & INTERNAL VARIABLES ------------------------------------------------------------------------

	//- PRIVATE & PROTECTED VARIABLES ----------------------------------------------------------------------
	private final String name;
	private final String packageName;
	private final int id;
	
	private AssociationEnd begin;
	private AssociationEnd end;
	
	//- CONSTRUCTOR ----------------------------------------------------------------------------------------
	public Association(int id, String name, String packageName){
		this.id = id;
		this.name = name;
		this.packageName = packageName;
	}
	
	//- PUBLIC & INTERNAL METHODS --------------------------------------------------------------------------

	//- PRIVATE & PROTECTED METHODS ------------------------------------------------------------------------

	//- GETTERS & SETTERS ----------------------------------------------------------------------------------
	public String getName() {
		return name;
	}

	public String getPackageName() {
		return packageName;
	}

	public int getId() {
		return id;
	}

	public void setBegin(AssociationEnd begin) {
		this.begin = begin;
	}

	public AssociationEnd getBegin() {
		return begin;
	}

	public void setEnd(AssociationEnd end) {
		this.end = end;
	}

	public AssociationEnd getEnd() {
		return end;
	}
}
